package com.cwl.base.day05.stream;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: java_base
 * @description:
 * @author: ChenWenLong
 * @create: 2019-11-12 11:35
 **/
public class Test {

    public static void main(String[] args) {

        List<Integer> integers = new ArrayList<>();
        integers.add(0);
        integers.add(1);
        integers.add(2);
        integers.add(3);

        List<Integer> integerList= new ArrayList<>();
        integerList.add(0);
        integerList.add(1);
        integerList.add(4);
        integerList.add(5);

        integerList.removeAll(integers);
        System.out.println(integerList);
    }
}
/*List<User> userList = new ArrayList<>();
        User user = new User(8, "陈毅");
        User user1 = new User(10, "陈东");
        User user2= new User(15, "陈小");
        userList.add(user);
        userList.add(user1);
        userList.add(user2);
        List<User> resultList = new ArrayList<>();
        userList.stream().filter(a -> a.getAge() > 10).forEach(
                a->{
                    resultList.add(a);
                }
        );
        System.out.println(resultList);*/
class User{

    private int age;
    private String name;

    @Override
    public String toString() {
        return "User{" +
                "age=" + age +
                ", name='" + name + '\'' +
                '}';
    }

    public User(int age, String name) {
        this.age = age;
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}

